(function (jQuery, $){ jQuery(function (){ 'use strict'; var indexURL=jQuery('link[rel="header_link"]').attr('href'); if(indexURL&&jQuery('header').length){ jQuery('header').attr('data-setlocation', indexURL); } $(document) .on('click.themler', ['a', 'form', 'input', 'button', 'textarea'].map(function(tag){ return 'header[data-setlocation] ' + tag; }).join(', '), function (e){ e.stopPropagation(); }) .on('click.themler', 'header[data-setlocation]', function (){ var elem=$(this), href=elem.data('setlocation'); window.location.href=href; }); function adminAffix(el){ el.off('affix-calc.theme.affix').on('affix-calc.theme.affix', function (e){ var offset=0, el=jQuery(this), fixAtScreen=jQuery(this).data('fixAtScreen'), elOffset=parseInt(el.data('offset'), 10)||0, adminHeight=jQuery('#wpadminbar').outerHeight()||0; if(fixAtScreen==='top'&&elOffset < adminHeight){ offset=adminHeight - elOffset; } e.offset=offset; }); } jQuery('body').on('affix-init.theme.affix', function (e, el){ if(!el) return; adminAffix(el); }); adminAffix(jQuery('[data-fix-at-screen]')); $('[data-smooth-scroll] a[href*="#"]').each(function (){ var href=$(this).attr('href'); if(href.indexOf(window.location.href)===0){ href=href.replace(window.location.href, ''); if(href.charAt(0)==='#'){ $(this).attr('href', href); }} }); if(window.wpJQuery){ window.wpJQuery(document.body).bind('added_to_cart', function (){ jQuery(document).trigger('force-grids-update'); }); } function setLocaleCookie(locale){ var expires=new Date(); expires.setFullYear(expires.getFullYear() + 100); document.cookie="language=" + locale + ";expires=" + expires.toGMTString() + ';path=/'; window.location.reload(); } jQuery('[item_id^=language_]').each(function(){ var item=jQuery(this); var itemId=item.attr('item_id'); var locale=itemId.substr(itemId.indexOf('_') + 1); item.click(function(){ setLocaleCookie(locale); }); }); }); window.isThemlerIframe=function(){ 'use strict'; try { return "undefined"!==typeof parent.AppController; } catch(e){ return false; }};})(window._$, window._$); (function (jQuery, $){ (function ($){ 'use strict'; window.initAffix=function initAffix(selector){ $('.bd-affix-fake').prev(':not([data-fix-at-screen])').next().remove(); $(selector).each(function (){ var element=$(this), offset={}, cachedOffset=null; element.off('.affix'); element.removeAttr('style'); element.removeClass($.fn.affix.Constructor.RESET); element.removeData('bs.affix'); offset.top=function (){ var hasAffix=element.hasClass('affix'); if(cachedOffset===null&&hasAffix){ element.removeClass('affix'); } if(!hasAffix){ var elTop=element.offset().top, offset=parseInt(element.data('offset'), 10)||0, clipAtControl=element.data('clipAtControl'), fixAtScreen=element.data('fixAtScreen'), elHeight=element.outerHeight(); var ev=$.Event('affix-calc.theme.affix'); element.trigger(ev); ev.offset=ev.offset||0; offset +=ev.offset; if(clipAtControl==='bottom'){ elTop +=elHeight; } if(fixAtScreen==='bottom'){ elTop +=offset; elTop -=$(window).height(); } if(fixAtScreen==='top'){ elTop -=offset; } cachedOffset=elTop; } if(cachedOffset===null&&hasAffix){ element.addClass('affix'); } return cachedOffset; }; element.on('affix.bs.affix', function (e){ var el=$(this), fake=el.next('.bd-affix-fake'); if(!fake.is(':visible')){ e.preventDefault(); return; } if(['absolute', 'fixed'].indexOf(el.css('position'))===-1){ fake.css('height', el.outerHeight(true)); } var body=$('body'); var bodyWidth=body.outerWidth()||1; var elWidth=el.outerWidth(); var elLeft=el.offset().left; el.css('width', (el.outerWidth() / bodyWidth * 100) + '%'); el.css('left', (elLeft / bodyWidth * 100) + '%'); el.css('right', ((bodyWidth - elLeft - elWidth) / bodyWidth * 100) + '%'); var offset=parseInt(element.data('offset'), 10)||0; var ev=$.Event('affix-calc.theme.affix'); el.trigger(ev); ev.offset=ev.offset||0; offset +=ev.offset; if(element.data('fixAtScreen')==='bottom'){ el.css('top', 'auto'); el.css('bottom', offset + 'px'); }else{ el.css('top', offset + 'px'); el.css('bottom', 'auto'); }}); element.on('affixed-top.bs.affix', function (){ $(this).next('.bd-affix-fake').removeAttr('style'); $(this).removeAttr('style'); }); if(!element.next('.bd-affix-fake').length){ element.after('
'); } $('body').trigger($.Event('affix-init.theme.affix'), [element]); element.affix({ 'offset': offset }); element.affix('checkPosition'); }); }; $(function ($){ var affixTimeout; $(window).on('resize', function (e, param){ clearTimeout(affixTimeout); if(param&¶m.force){ window.initAffix('[data-affix]'); }else{ affixTimeout=setTimeout(function (){ window.initAffix('[data-affix]'); }, 100); }}); window.initAffix('[data-affix]'); }); })(jQuery); })(window._$, window._$); (function (jQuery, $){ (function($){ 'use strict'; var $w=$(window); $.fn.visible=function(partial,hidden,direction){ if(this.length < 1) return; var $t=this.length > 1 ? this.eq(0):this, t=$t.get(0), vpWidth=$w.width(), vpHeight=$w.height(), direction=(direction) ? direction:'both', clientSize=hidden===true ? t.offsetWidth * t.offsetHeight:true; if(typeof t.getBoundingClientRect==='function'){ var rec=t.getBoundingClientRect(), tViz=rec.top >=0&&rec.top < vpHeight, bViz=rec.bottom > 0&&rec.bottom <=vpHeight, lViz=rec.left >=0&&rec.left < vpWidth, rViz=rec.right > 0&&rec.right <=vpWidth, vVisible=partial ? tViz||bViz:tViz&&bViz, hVisible=partial ? lViz||rViz:lViz&&rViz; if(direction==='both') return clientSize&&vVisible&&hVisible; else if(direction==='vertical') return clientSize&&vVisible; else if(direction==='horizontal') return clientSize&&hVisible; }else{ var viewTop=$w.scrollTop(), viewBottom=viewTop + vpHeight, viewLeft=$w.scrollLeft(), viewRight=viewLeft + vpWidth, offset=$t.offset(), _top=offset.top, _bottom=_top + $t.height(), _left=offset.left, _right=_left + $t.width(), compareTop=partial===true ? _bottom:_top, compareBottom=partial===true ? _top:_bottom, compareLeft=partial===true ? _right:_left, compareRight=partial===true ? _left:_right; if(direction==='both') return !!clientSize&&((compareBottom <=viewBottom)&&(compareTop >=viewTop))&&((compareRight <=viewRight)&&(compareLeft >=viewLeft)); else if(direction==='vertical') return !!clientSize&&((compareBottom <=viewBottom)&&(compareTop >=viewTop)); else if(direction==='horizontal') return !!clientSize&&((compareRight <=viewRight)&&(compareLeft >=viewLeft)); }}; $(function(){ if($.support.transition&&!$.event.special.bsTransitionEnd){ $.event.special[$.support.transition.end]={ handle: function (e){ if($(e.target).is(this)){ return e.handleObj.handler.apply(this, arguments); }} };}}); function getQueue(effect){ if(effect.is('.animated[data-animation-event]')&&!effect.data('animation-queue')){ effect.data('animation-queue', new AsyncQueue(effect)); } return effect.data('animation-queue'); } function runAnimation(effect, eventName){ var queue=getQueue(effect); if(queue){ queue.push(eventName); }} function abortAnimation(effect){ var queue=getQueue(effect); if(queue){ queue.abort(); }} function visibilityImmediate(effect, value){ effect.css('transition', value==='hidden' ? 'none':''); effect.css('visibility', value); } $(window).resize(function(){ $('.animated[data-animation-event*="onloadinterval"]').each(function(){ var effect=$(this); runAnimation(effect, 'onloadinterval'); }); }); $(function(){ $(document).on('mouseover', '.animated[data-animation-event*="hover"]', function(){ runAnimation($(this), 'hover'); }); $('.animated[data-animation-event*="scroll"]').each(function(){ var effect=$(this); if(!getMetaData(effect, 'scroll')){ return; } if(needToHide(effect, 'scroll')){ visibilityImmediate(effect, 'hidden'); }}); $(document).on('scroll', function(){ $('.animated[data-animation-event*="scroll"]').each(function (){ var effect=$(this); if(!getMetaData(effect, 'scroll')){ return; } if(effect.visible(true)){ runAnimation(effect, 'scroll'); }}); }); $(document).on('scroll', function(){ $('.animated[data-animation-event*="scrollloop"]').each(function (){ var effect=$(this); if(effect.visible(true)){ if(!effect.data('scrollloop-animation-played')){ effect.data('scrollloop-animation-played', true); runAnimation(effect, 'scrollloop'); }}else{ effect.removeData('scrollloop-animation-played'); }}); }); $('.animated[data-animation-event*="onload"]').each(function(){ var effect=$(this); if(!getMetaData(effect, 'onload')){ return; } runAnimation(effect, 'onload'); }); $('.animated[data-animation-event*="onloadinterval"]').each(function(){ var effect=$(this); runAnimation(effect, 'onloadinterval'); }); var slideinEffects=$('.animated[data-animation-event*="slidein"]'); slideinEffects.each(function(){ var effect=$(this); if(needToHide(effect, 'slidein')){ visibilityImmediate(effect, 'hidden'); }}); var carouselsSlidein=slideinEffects.parents('.carousel'); $(document).on('slid.bs.carousel', '.carousel', function(){ $(this) .find('.item.active') .find('.animated[data-animation-event*="slidein"]') .each(function(){ runAnimation($(this), 'slidein'); }); $(this) .find('.item:not(.active)') .find('.animated[data-animation-event*="slideout"]').each(function(){ var effect=$(this); visibilityImmediate(effect, ''); }); $(this) .find('.item:not(.active)') .find('.animated[data-animation-event*="slidein"]') .each(function(){ var effect=$(this); if(needToHide(effect, 'slidein')){ visibilityImmediate(effect, 'hidden'); }}); }); carouselsSlidein.trigger('slid.bs.carousel'); var moveSlide=false; $(document).on('slide.bs.carousel', '.carousel', function(event){ var effects=$(this) .find('.item.active .animated[data-animation-event*="slideout"]'); if(effects.length&&!moveSlide){ event.isDefaultPrevented=function (){ return true; }; effects.each(function(){ var effect=$(this); if(!effect.data('slideout-played')){ effect.data('slideout-played', true); abortAnimation(effect); runAnimation(effect, 'slideout'); } setTimeout(function (){ if(needToHide(effect, 'slideout')){ visibilityImmediate(effect, 'hidden'); }}.bind(effect), getAnimationTime(effect, 'slideout')); }); var eventDirection=event.direction==='left' ? 'next':'prev'; var maxDuration=getMaxDuration(effects, 'slideout'); setTimeout(function (){ effects.each(function(){ var effect=$(this); if(needToHide(effect, 'slideout')){ visibilityImmediate(effect, 'hidden'); } if(effect.data('slideout-played')){ effect.data('slideout-played', false); }}); moveSlide=true; $(this) .find('.item.active .animated[data-animation-event*="slidein"]') .each(function(){ abortAnimation($(this)); }); $(this).carousel(eventDirection); }.bind(this), maxDuration); }else{ moveSlide=false; }}); }); function AsyncQueue(dom){ this.dom=dom; this.queue=[]; this.current=null; this.push=function(animation){ if(this.queue.indexOf(animation)===-1&&(!this.current||this.current.type!==animation)){ this.queue.push(animation); } this.tryStart(); }; this.tryStart=function(){ if(!this.current&&this.queue.length){ this.current=new animationEvents[this.queue.shift()](this.dom); this.current.start(function(){ this.current=null; this.tryStart(); }.bind(this)); }}; this.abort=function(){ if(this.queue.indexOf('onloadinterval')!==-1){ setTimeout(function(){ this.push('onloadinterval'); }.bind(this), 100); } this.queue=[]; if(this.current){ this.current.abort(); }};} var animationEvents={ hover: AnimationHover, scroll: AnimationScroll, scrollloop: AnimationScrollLoop, onload: AnimationOnload, onloadinterval: AnimationOnloadInterval, slidein: AnimationSlidein, slideout: AnimationSlideout }; function BaseAnimation(){} BaseAnimation.prototype.start=function(nextAnimation){ visibilityImmediate(this.dom, ''); this.nextAnimation=nextAnimation; startAnimation(this.dom, this.type); this.timer=waitEnd(this.dom, this.type, function(){ stopAnimation(this.dom, this.type); this.nextAnimation(); }.bind(this)); }; BaseAnimation.prototype.abort=function(){ clearTimeout(this.timer); stopAnimation(this.dom, this.type); this.nextAnimation(); }; function AnimationHover(dom){ this.dom=dom; this.type='hover'; } AnimationHover.prototype=Object.create(BaseAnimation.prototype); function AnimationScroll(dom){ this.dom=dom; this.type='scroll'; } AnimationScroll.prototype=Object.create(BaseAnimation.prototype); AnimationScroll.prototype.start=function(nextAnimation){ if(this.dom.data('scroll-animation-done')){ nextAnimation(); return; } BaseAnimation.prototype.start.call(this, function(){ this.dom.data('scroll-animation-done', true); nextAnimation(); }.bind(this)); }; function AnimationScrollLoop(dom){ this.dom=dom; this.type='scrollloop'; } AnimationScrollLoop.prototype=Object.create(BaseAnimation.prototype); function AnimationOnload(dom){ this.dom=dom; this.type='onload'; } AnimationOnload.prototype=Object.create(BaseAnimation.prototype); function AnimationOnloadInterval(dom){ this.dom=dom; this.type='onloadinterval'; } AnimationOnloadInterval.prototype=Object.create(BaseAnimation.prototype); AnimationOnloadInterval.prototype.start=function(nextAnimation){ BaseAnimation.prototype.start.call(this, function(){ setTimeout(function(){ runAnimation(this.dom, 'onloadinterval'); }.bind(this), 50); nextAnimation(); }.bind(this)); }; function AnimationSlidein(dom){ this.dom=dom; this.type='slidein'; } AnimationSlidein.prototype=Object.create(BaseAnimation.prototype); function AnimationSlideout(dom){ this.dom=dom; this.type='slideout'; } AnimationSlideout.prototype=Object.create(BaseAnimation.prototype); function startAnimation(dom, eventName){ var data=getMetaData(dom, eventName); if(data){ dom.addClass(data.name); }} function stopAnimation(dom, eventName){ var data=getMetaData(dom, eventName); if(data){ dom.removeClass(data.name); }} function waitEnd(dom, eventName, cb){ var data=getMetaData(dom, eventName); if(!data){ cb(); return; } var duration=isNaN(parseFloat(data.duration)) ? 1000:parseFloat(data.duration); var delay=isNaN(parseFloat(data.delay)) ? 0:parseFloat(data.delay); if(data.infinited==='true'){ return; } return setTimeout(function(){ cb(); }, delay + duration); } function getMetaData(dom, eventName){ var result; dom=$(dom); var tmp={ name: dom.data('animation-name'), event: dom.data('animation-event'), duration: dom.data('animation-duration'), delay: dom.data('animation-delay'), infinited: dom.data('animation-infinited'), display: dom.data('animation-display') }; for(var i in tmp){ tmp[i]=String(tmp[i]).split(','); } for(var i=0; i < tmp.name.length; i++){ if(eventName===tmp.event[i]){ result={ name: tmp.name[i], event: tmp.event[i], duration: tmp.duration[i], delay: tmp.delay[i], infinited: tmp.infinited[i], display: tmp.display[i] }; if(eventName==='slideout'){ result.infinited='false'; } return result; }} } function needToHide(effect, eventName){ var data=getMetaData(effect, eventName); var visibleAnimations=['bounce', 'flash', 'pulse', 'rubber', 'band','snake','swing','tada','wobble', 'slideindown' , 'slideinleft' , 'slideinright', 'slideinup', 'slideoutdown', 'slideoutleft', 'slideoutright', 'slideoutup']; return visibleAnimations.indexOf(data.name.toLowerCase())===-1; } function getMaxDuration(effects, eventName){ var maxDuration=0; effects.each(function (){ var animationTime=getAnimationTime($(this), eventName); maxDuration=maxDuration < animationTime ? animationTime:maxDuration; }); return maxDuration; } function getAnimationTime(effect, eventName){ var data=getMetaData(effect, eventName); if(!data){ return 0; } var duration=isNaN(parseFloat(data.duration)) ? 0:parseFloat(data.duration), delay=isNaN(parseFloat(data.delay)) ? 0:parseFloat(data.delay); return duration + delay; }})(jQuery); })(window._$, window._$); (function (jQuery, $){ (function SeparatedGrid($){ 'use strict'; var row=[], getOffset=function getOffset(el){ var isInline=false; el.css('position', 'relative'); if(el.css('display')==='inline'){ el.css('display', 'inline-block'); isInline=true; } var offset=el.position().top; if(isInline){ el.css('display', 'inline'); } return offset; }, getCollapsedMargin=function getCollapsedMargin(el){ if(el.css('display')==='block'){ var m0=parseFloat(el.css('margin-top')); if(m0 > 0){ var p=el.prev(); var prop='margin-bottom'; if(p.length < 1){ p=el.parent(); prop='margin-top'; } if(p.length > 0&&p.css('display')==='block'){ var m=parseFloat(p.css(prop)); if(m > 0){ return Math.min(m0, m); }} }} return 0; }, classRE1=new RegExp('^bd-.*-\\d+$'), classRE2=new RegExp('^bd-.*$'), getClass=function getClass(el){ var i; for (i=0; i < el.classList.length; i++){ if(classRE1.test(el.classList[i])){ return el.classList[i]; }} for (i=0; i < el.classList.length; i++){ if(classRE2.test(el.classList[i])){ return el.classList[i]; }} }, childFilter=function childFilter(){ return !!getClass(this); }, getDeeper=function (roots){ while (roots.length&&roots.length===roots.children().length){ roots=roots.children(); } return roots; }, calcOrder=function calcOrder(items){ var roots=getDeeper(items); var childrenClasses=[]; var childrenWeights={}; var getNextWeight=function getNextWeight(children, i, l){ for (var j=i + 1; j < l; j++){ var cls=getClass(children[j]); if(childrenClasses.indexOf(cls)!==-1){ return childrenWeights[cls]; }} return 100; }; roots.each(function calcWeight(i, root){ var children=$(root).children().filter(childFilter); var previousWeight=0; for (var c=0, l=children.length; c < l; c++){ var cls=getClass(children[c]); if(!cls||cls.length < 1){ continue; } if(childrenClasses.indexOf(cls)===-1){ var nextWeight=getNextWeight(children, c, l); childrenWeights[cls]=previousWeight + (nextWeight - previousWeight) / 10; childrenClasses.push(cls); } previousWeight=childrenWeights[cls]; }}); childrenClasses.sort(function sortWeight(a, b){ return childrenWeights[a] > childrenWeights[b]; }); return childrenClasses; }; var calcRow=function calcRow(helpNodes, last, order){ $(row).css({'overflow': 'visible', 'height': 'auto'}).toggleClass('last-row', last); if(row.length > 0){ var roots=$(row); roots.removeClass('last-col').last().addClass('last-col'); roots=getDeeper(roots); var createHelpNode=function createHelpNode(fix){ var helpNode=document.createElement('div'); helpNode.setAttribute('style', 'height:' + fix + 'px'); helpNode.className='bd-empty-grid-item'; helpNodes.push(helpNode); return helpNode; }; var cls=''; var maxOffset=0; var calcMaxOffsets=function calcMaxOffsets(i, root){ var el=$(root).children('.' + cls + ':visible:first'); if(el.length < 1||el.css('position')==='absolute'){ return; } var offset=getOffset(el); if(offset > maxOffset){ maxOffset=offset; }}; var setMaxOffsets=function setMaxOffsets(i, root){ var el=$(root).children('.' + cls + ':visible:first'); if(el.length < 1||el.css('position')==='absolute'){ return; } var offset=getOffset(el); var fix=maxOffset - offset - getCollapsedMargin(el); if(fix > 0){ el.before(createHelpNode(fix)); }}; for (var c=0; c < order.length; c++){ maxOffset=0; cls=order[c]; roots.each(calcMaxOffsets); maxOffset=Math.ceil(maxOffset); roots.each(setMaxOffsets); } var hMax=0; $.each(roots, function calcMaxHeight(i, e){ var h=$(e).outerHeight(); if(hMax < h){ hMax=h; }}); hMax=Math.ceil(hMax); $.each(roots, function setMaxHeight(i, e){ var el=$(e); var fix=hMax - el.outerHeight(); if(fix > 0){ el.append(createHelpNode(fix)); }}); $(row).css('min-height', (hMax + 1) + 'px'); } row=[]; }; var itemsRE=new RegExp('.*(separated-item[^\\s]+).*'), resize=function resize(force){ var grid=$('.separated-grid'); grid.each(function eachGrid(i, gridElement){ var g=$(gridElement); if(!g.is(':visible')){ return; } if(!gridElement._item||!gridElement._item.length||!gridElement._item.is(':visible')){ gridElement._item=g.find('div[class*=separated-item]:visible:first'); if(!gridElement._item.length){ return; } gridElement._items=g.find('div.' + gridElement._item.attr('class').replace(itemsRE, '$1') ).filter(function (){ return $(this).parents('.separated-grid')[0]===gridElement; }); } var items=gridElement._items; if(!items.length){ return; } var h=0; for (var k=0; k < items.length; k++){ var el=$(items[k]); var _h=el.height(); if(el.is('.first-col')){ h=_h; } if(h!==_h){ gridElement._height=0; }} if(!force&&g.innerHeight()===gridElement._height&&g.innerWidth()===gridElement._width){ return; } var windowScrollTop=$(window).scrollTop(); items.css({'overflow': 'hidden', 'height': '10px', 'min-height': ''}).removeClass('last-row'); if(gridElement._helpNodes){ $(gridElement._helpNodes).remove(); } gridElement._helpNodes=[]; var firstLeft=items.position().left; var order=calcOrder(items); var notDisplayed=[]; var lastItem=null; items.each(function eachItems(i, gridItem){ var item=$(gridItem); var p=item; do { if(p.css('display')==='none'){ p.data('style', p.attr('style')).css('display', 'block'); notDisplayed.push(p[0]); } p=p.parent(); } while (p.length > 0&&p[0]!==gridElement&&!item.is(':visible')); var first=firstLeft >=item.position().left; if(first&&row.length > 0){ calcRow(gridElement._helpNodes, lastItem&&lastItem.parentNode!==gridItem.parentNode, order); } row.push(gridItem); item.toggleClass('first-col', first); if(i===items.length - 1){ calcRow(gridElement._helpNodes, true, order); } lastItem=gridItem; }); $(notDisplayed).each(function eachHidden(i, e){ var el=$(e); var css=el.data('style'); el.removeData('style'); if('undefined'!==typeof css){ el.attr('style', css); }else{ el.removeAttr('style'); }}); gridElement._width=g.innerWidth(); gridElement._height=g.innerHeight(); $(window).scrollTop(windowScrollTop); $(window).off('resize', lazy); $(window).resize(); $(window).on('resize', lazy); }); }, timeoutLazy, lazy=function lazy(e, param){ clearTimeout(timeoutLazy); if(param&¶m.force){ resize(); }else{ timeoutLazy=setTimeout(resize, 100, e&&e.type==='resize'); }}, interval=function interval(){ lazy(); setTimeout(interval, 1000); }; $(window).resize(lazy); $(interval); $(document).bind('force-grids-update', resize); $(document).bind('force-grid-update', function (event, grid){ if(grid&&grid.length){ grid.each(function (i, gridElement){ delete gridElement._height; delete gridElement._width; delete gridElement._helpNodes; }); grid.find('.bd-empty-grid-item').remove(); resize(); }}); })(jQuery); })(window._$, window._$); (function (jQuery, $){ (function ($){ 'use strict'; $(onLoad); var timeout; $(window).on('resize', function (event, param){ clearTimeout(timeout); if(param&¶m.force){ applyImageScalling(); }else{ timeout=setTimeout(function (){ applyImageScalling(); }, 100); }}); function onLoad(){ $(".bd-imagescaling").each(function (){ var c=$(this); if(c.length){ var img=c.is('img') ? c:c.find('img'); scaling(img); img.on('load', function (){ scaling(img); }); }}); } function applyImageScalling(){ $(".bd-imagescaling").each(function (){ var c=$(this); if(c.length){ var img=c.is('img') ? c:c.find('img'); scaling(img); }}); } function scaling(img){ var imgSrc=img.attr('src')||'', imgClass=img.attr('class')||''; var imgWrapper=img.parent('.bd-imagescaling-img'); if(!imgWrapper.length||imgClass){ if(img.parent().is('.bd-imagescaling-img')){ img.unwrap(); } imgWrapper=img.wrap('').parent(); img.removeAttr('class'); } if(imgSrc.indexOf('.')===0){ imgSrc=combineUrl(window.location.href, imgSrc); } if(imgWrapper.siblings('.bd-parallax-image-wrapper').length===0){ imgWrapper.css('background-image', 'url(' + imgSrc + ')'); }} function combineUrl(base, relative){ if(!relative){ return base; } var stack=base.split("/"), parts=relative.split("/"); stack.pop(); for (var i=0; i < parts.length; i++){ if(parts[i]===".") continue; if(parts[i]==="..") stack.pop(); else stack.push(parts[i]); } return stack.join("/"); }})(jQuery); })(window._$, window._$); (function (jQuery, $){ window.ThemeLightbox=(function ($){ 'use strict'; return (function ThemeLightbox(selectors){ var selector=selectors; var images=$(selector); var current; var close=function (){ $(".bd-lightbox").remove(); }; this.init=function (){ $(selector).mouseup(function (e){ if(e.which&&e.which!==1){ return; } current=images.index(this); var imgContainer=$('.bd-lightbox'); if(imgContainer.length===0){ imgContainer=$('